package core.manager.sceneManager.SceneScript
{
    import core.manager.pluginManager.*;
    import core.manager.scriptManager.*;
    import org.papervision3d.core.geom.renderables.*;

    public class Scene1Script
    {
        public static function runSceneJustCompleteScript(IRenderable:int) : void
        {
            switch(IRenderable)
            {
                case 0:
                {
                    ScriptManager.getInstance().runScriptByName(ScriptName.SET_CAMERA_ROTATION_Y, [122.5]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.SET_CAMERA_FOCUS, [375]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.ADD_ANIMATE, [3]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.START_RENDER, []);
                    break;
                }
                case 2:
                {
                    ScriptManager.getInstance().runScriptByName(ScriptName.SET_CAMERA_ROTATION_Y, [122.5]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.SET_CAMERA_FOCUS, [375]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.ADD_ANIMATE, [3]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.START_RENDER, []);
                    ScriptManager.getInstance().runScriptByName(ScriptName.LOAD_BACKGROUND_MUSIC, ["http://audio.pavilion.expo.cn/p5006/audio/backgroundmusic/bg1.mp3"]);
                    break;
                }
                default:
                {
                    ScriptManager.getInstance().runScriptByName(ScriptName.SET_CAMERA_ROTATION_Y, [62.5]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.SET_CAMERA_ROTATION_X, [0.8]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.SET_CAMERA_FOCUS, [375]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.ADD_ANIMATE, [3]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.START_RENDER, []);
                    ScriptManager.getInstance().runScriptByName(ScriptName.LOAD_BACKGROUND_MUSIC, ["http://audio.pavilion.expo.cn/p5006/audio/backgroundmusic/bg1.mp3"]);
                    break;
                    break;
                }
            }
            return;
        }// end function

        public static function runSceneInitScript(IRenderable:int) : void
        {
            switch(IRenderable)
            {
                case 0:
                {
                    ScriptManager.getInstance().runScriptByName(ScriptName.ADD_CONTROLER_COMPLETE_SCRIPT, ["showFlv(http://flv.pavilion.expo.cn/p5006/flv/scene_scene/0_1.flv);"]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.ADD_CONTROLER_COMPLETE_SCRIPT, ["stopRender();"]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.SET_CAMERA, [0.3, 100]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.INIT_ON_FLV_PLAY_COMPLETE_SCRIPT, ["goto3DScene(1);"]);
                    break;
                }
                case 2:
                {
                    ScriptManager.getInstance().runScriptByName(ScriptName.ADD_CONTROLER_COMPLETE_SCRIPT, ["goto3DScene(1);"]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.SET_CAMERA, [0.3, 260.687]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.DISPOSE_BACKGROUND_MUSIC, []);
                    break;
                }
                default:
                {
                    PluginManager.getInstance().showSinglePluginById("Pv3dModule");
                    ScriptManager.getInstance().runScriptUntilScriptExist("goto3DScene(1);");
                    ScriptManager.getInstance().runScriptByName(ScriptName.DISPOSE_BACKGROUND_MUSIC, []);
                    break;
                    break;
                }
            }
            return;
        }// end function

    }
}
